/**
 * Copyright (c) 2018-2028.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.sailmi.gateway.provider;

import com.sailmi.common.constant.TokenConstant;

import java.util.ArrayList;
import java.util.List;

/**
 * 鉴权配置
 *
 * @author yzh
 */
public class AuthProvider {

	public static String TARGET = "/**";
	public static String REPLACEMENT = "";
	public static String AUTH_KEY = TokenConstant.HEADER;
	private static final List<String> defaultSkipUrl = new ArrayList<>();
	private static final List<String> defaultRejectUrl = new ArrayList<>();
	private static final List<String> defaultKickUrl = new ArrayList<>();
	private static final List<String> defaultExitUrl = new ArrayList<>();


	static {
		defaultSkipUrl.add("/register/**");
		defaultSkipUrl.add("/token/**");
		defaultSkipUrl.add("/renewToken/**");
		defaultSkipUrl.add("/captcha/**");
		defaultSkipUrl.add("/auth/**");
		defaultSkipUrl.add("/log/**");
		defaultSkipUrl.add("/error/**");
		defaultSkipUrl.add("/assets/**");
		defaultSkipUrl.add("/get-file/**");
		defaultSkipUrl.add("/privateServer/**");
		defaultSkipUrl.add("/publicServer/**");
		defaultSkipUrl.add("/TESocket/**");
		defaultSkipUrl.add("/export/**");
		//测试性方法
		defaultExitUrl.add("/logout/**");
	}

	/**
	 * 默认无需鉴权的API
	 */
	public static List<String> getDefaultSkipUrl() {
		return defaultSkipUrl;
	}

	/**
	 * 默认需要竞争登录的API，即有登录的情况下拒约访问
	 */
	public static List<String> getDefaultRejectUrl() {
		return defaultRejectUrl;
	}

	/**
	 * 默认需要竞争登录的API，即有登录的情况下强制下线原有登录
	 */
	public static List<String> getDefaultKickUrl() {
		return defaultKickUrl;
	}
	/**
	 * 默认需要竞争登录的API，即有登录的情况下强制下线原有登录
	 */
	public static List<String> getDefaultExitUrl() {
		return defaultExitUrl;
	}

}
